# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/tora/tora-1.3.21-r1.ebuild,v 1.10 2007/11/20 05:37:25 hawking Exp $

inherit subversion eutils cmake-utils
EAPI="1"

IUSE="debug"
DESCRIPTION="TOra - Toolkit For Oracle"
HOMEPAGE="http://tora.sourceforge.net"
ESVN_REPO_URI="https://tora.svn.sourceforge.net/svnroot/tora/trunk/tora"

SLOT="2"
LICENSE="GPL-2"
KEYWORDS="alpha amd64 hppa ppc ~sparc x86"

DEPEND="x11-libs/qt-core:4
    >=dev-util/cmake-2.6.0
	dev-lang/perl
	>=x11-libs/qscintilla-2.1
	xinerama? ( x11-proto/xineramaproto )
	~dev-db/oracle-instantclient-basic-11.1.0.7.0"

src_unpack() {
	subversion_src_unpack
}

src_compile() {
	mycmakeargs="${mycmakeargs} -DORACLE_OCI_VERSION=11G"
	mycmakeargs="${mycmakeargs} -DQSCINTILLA_INCLUDE_DIR=/usr/include/Qsci"
	sed -i 's!SET (VERSION_SUFFIX "")!SET (VERSION_SUFFIX "-r'$ESVN_WC_REVISION'")!' \
	    ${S}/CMakeLists.txt
	sed -i "s!1.4.0svn!2.x-r${ESVN_WC_REVISION}!" ${S}/config.h.cmake
	sed -i 's!SET_CLIENT_INFO('\''" TOAPPNAME!SET_CLIENT_INFO('\''TOra-2.x-r'$ESVN_WC_REVISION'"!' ${S}/src/tooracleconnection.cpp
	ORACLE_HOME="/usr/lib/oracle/11.1.0.7.0/client"
	use debug && mycmakeargs="${mycmakeargs} -DWANT_DEBUG=1"
	cmake-utils_src_compile
}

#src_install() {
#	cmake-utils_src_install
#	dodoc AUTHORS CHANGELOG README RELEASE || die "installing docs failed"
#}
